package cn.edu.nju.software.cdiy.bean;

import java.io.Serializable;
import java.util.Date;

public class Mouse extends Hardware implements Comparable<Mouse>, Serializable {

	private static final long serialVersionUID = -2498294809041783130L;
	private int id;
	// 型号1
	private String model;

	// 外键品牌表1
	private BRD_MOUSE brand;

	// 外键接口表1
	private Interface mouseInterface;

	// 次要指标14
	private String connectionMode;
	private String operatingMode;
	private String mSize;
	private String applicableType;
	private int keyNumber;
	private String wheelDirection;
	private String ergonomics;
	private String DPI;
	private String surfaceColor;
	private String CSPhone;
	private String qualityPolicy;
	private String qualityTime;
	private String qualityContent;
	private String attachment;

	// 管理类参数6
	private int iPrice;
	private int oPrice;
	private int performance;
	private Date inStorageTime;
	private String imgPath;
	private Value state; // 外键；{0:审核中 1:已通过}
	private double wScore;
	private double zScore;
	private int supplier;

	private int sale;
	private String rsv2;
	private String rsv3;

	public String getModel() {
		return model;
	}

	public void setModel(String model) {
		this.model = model;
	}

	public BRD_MOUSE getBrand() {
		return brand;
	}

	public void setBrand(BRD_MOUSE brand) {
		this.brand = brand;
	}

	public Interface getMouseInterface() {
		return mouseInterface;
	}

	public void setMouseInterface(Interface mouseInterface) {
		this.mouseInterface = mouseInterface;
	}

	public String getConnectionMode() {
		return connectionMode;
	}

	public void setConnectionMode(String connectionMode) {
		this.connectionMode = connectionMode;
	}

	public String getOperatingMode() {
		return operatingMode;
	}

	public void setOperatingMode(String operatingMode) {
		this.operatingMode = operatingMode;
	}

	public String getmSize() {
		return mSize;
	}

	public void setmSize(String mSize) {
		this.mSize = mSize;
	}

	public String getApplicableType() {
		return applicableType;
	}

	public void setApplicableType(String applicableType) {
		this.applicableType = applicableType;
	}

	public int getKeyNumber() {
		return keyNumber;
	}

	public void setKeyNumber(int keyNumber) {
		this.keyNumber = keyNumber;
	}

	public String getWheelDirection() {
		return wheelDirection;
	}

	public void setWheelDirection(String wheelDirection) {
		this.wheelDirection = wheelDirection;
	}

	public String getErgonomics() {
		return ergonomics;
	}

	public void setErgonomics(String ergonomics) {
		this.ergonomics = ergonomics;
	}

	public String getDPI() {
		return DPI;
	}

	public void setDPI(String dPI) {
		DPI = dPI;
	}

	public String getSurfaceColor() {
		return surfaceColor;
	}

	public void setSurfaceColor(String surfaceColor) {
		this.surfaceColor = surfaceColor;
	}

	public String getCSPhone() {
		return CSPhone;
	}

	public void setCSPhone(String cSPhone) {
		CSPhone = cSPhone;
	}

	public String getQualityPolicy() {
		return qualityPolicy;
	}

	public void setQualityPolicy(String qualityPolicy) {
		this.qualityPolicy = qualityPolicy;
	}

	public String getQualityTime() {
		return qualityTime;
	}

	public void setQualityTime(String qualityTime) {
		this.qualityTime = qualityTime;
	}

	public String getQualityContent() {
		return qualityContent;
	}

	public void setQualityContent(String qualityContent) {
		this.qualityContent = qualityContent;
	}

	public String getAttachment() {
		return attachment;
	}

	public void setAttachment(String attachment) {
		this.attachment = attachment;
	}

	public int getiPrice() {
		return iPrice;
	}

	public void setiPrice(int iPrice) {
		this.iPrice = iPrice;
	}

	public int getoPrice() {
		return oPrice;
	}

	public void setoPrice(int oPrice) {
		this.oPrice = oPrice;
	}

	public int getPerformance() {
		return performance;
	}

	public void setPerformance(int performance) {
		this.performance = performance;
	}

	public Date getInStorageTime() {
		return inStorageTime;
	}

	public void setInStorageTime(Date inStorageTime) {
		this.inStorageTime = inStorageTime;
	}

	public String getImgPath() {
		return imgPath;
	}

	public void setImgPath(String imgPath) {
		this.imgPath = imgPath;
	}

	public Value getState() {
		return state;
	}

	public void setState(Value state) {
		this.state = state;
	}

	public double getwScore() {
		return wScore;
	}

	public void setwScore(double wScore) {
		this.wScore = wScore;
	}

	public double getzScore() {
		return zScore;
	}

	public void setzScore(double zScore) {
		this.zScore = zScore;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getSupplier() {
		return supplier;
	}

	public void setSupplier(int supplier) {
		this.supplier = supplier;
	}

	public int getSale() {
		return sale;
	}

	public void setSale(int sale) {
		this.sale = sale;
	}

	public String getRsv2() {
		return rsv2;
	}

	public void setRsv2(String rsv2) {
		this.rsv2 = rsv2;
	}

	public String getRsv3() {
		return rsv3;
	}

	public void setRsv3(String rsv3) {
		this.rsv3 = rsv3;
	}

	@Override
	public int compareTo(Mouse o) {

		Date now = new Date();

		// this的热度
		long gap = now.getTime() - inStorageTime.getTime();
		int gapDay = (int) (gap / (24 * 3600 * 1000));

		double nowHot = sale / gapDay;

		// 参数的hot
		long oGap = now.getTime() - o.getInStorageTime().getTime();
		int oGapDay = (int) (oGap / (24 * 3600 * 1000)) + 1;

		double oHot = o.getSale() / oGapDay;

		// 降序排列
		if (nowHot > oHot)
			return -1;
		else if (nowHot == oHot)
			return 0;
		else
			return 1;
	}

}
